<!-- php:$title = "在线付款（".$rs.sn."）_我的订单_会员中心" -->
<!-- include tpl=header title=$title -->
<section class="container"><div class="mt-3"><!-- include tpl=block/breadcrumb leader=$leader --></div></section>

<section class="container">
	<form method="post" target="_blank" action="{if $session.user_id}{url ctrl=payment func=create id=$rs.id/}{else}{url ctrl=payment func=create sn=$rs.sn passwd=$rs.passwd/}{/if}">
	<div class="card">
		<div class="card-header">订单信息</div>
		<ul class="list-group list-group-flush">
			<li class="list-group-item">
				<div class="row">
					<div class="col-sm-4 text-right">订单编号</div>
					<div class="col-sm-8">{$rs.sn}</div>
				</div>
			</li>
			<li class="list-group-item">
				<div class="row">
					<div class="col-sm-4 text-right">订单金额</div>
					<div class="col-sm-8 am-text-primary">{func price_format $rs.price $rs.currency_id}</div>
				</div>
			</li>
			<!-- if $price_paid -->
			<li class="list-group-item">
				<div class="row">
					<div class="col-sm-4 text-right">已付款</div>
					<div class="col-sm-8 am-text-primary">{func price_format $price_paid $rs.currency_id}</div>
				</div>
			</li>
			<!-- /if -->
			<!-- if $price_unpaid -->
			<li class="list-group-item">
				<div class="row">
					<div class="col-sm-4 text-right">还需付款</div>
					<div class="col-sm-8 am-text-danger">{func price_format $price_unpaid $rs.currency_id}</div>
				</div>
			</li>
			<!-- /if -->
		</ul>
	</div>
	<!-- if $integral -->
	<div class="card mt-3">
		<div class="card-header">积分抵扣，仅支持100的整数倍，不支持小数</div>
		<ul class="list-group list-group-flush">
			<!-- loop from=$integral key=$key value=$value -->
		    <li class="list-group-item">
			    <div class="row">
				    <div class="col-sm-8">您当前的 <span class="am-text-danger">{$value.title}</span> 有 <span class="am-text-danger">{$value.val}</span>{$value.unit}，最多可抵现金<span class="red">{func price_format $value.price}</span></div>
				    <div class="col-sm-4">
					    <table>
					    	<tr>
					    		<td style="width:60px;text-align:right;">支出：</td>
					    		<td><input type="text" name="integral_val[{$key}]" class="form-control" data-name="integral" data-key="{$key}" /></td>
					    		<td>&nbsp;{$value.unit}</td>
					    	</tr>
					    </table>
				    </div>
			    </div>
		    </li>
		    <!-- /loop -->
		</ul>
	</div>
	<!-- /if -->
	<!-- if $balance -->
	<div class="card mt-3">
		<div class="card-header">余额支付</div>
		<div class="card-body">
			<!-- loop from=$balance key=$key value=$value -->
			<div class="form-check">
				<label class="form-check-label mb-2">
			    	<input type="radio" class="form-check-input" name="payment" value="{$value.identifier}" data-price="{$price_val}" data-balance="{$value.price}" />
			    	您当前的{$value.title}有<span class="red">{$value.val}</span>{$value.unit}
			    	<!-- if $price_val > $value.price -->
					，您的{$value.title}不够，请 <a href="{url ctrl=payment id=$value.id/}" target="_blank"><b>在线充值</b></a>
					<!-- /if -->
				</label>
			</div>
			<!-- /loop -->
		</div>
	</div>
	<!-- /if -->
	<!-- loop from=$paylist key=$key value=$value id=$tmpid -->
	<div class="card mt-3">
		<div class="card-header">{$value.title}</div>
		<div class="card-body">
			<!-- loop from=$value.paylist key=$k value=$v id=$idxx -->
			<div class="form-check">
				<label class="form-check-label mb-2">
			    	<input type="radio" class="form-check-input" name="payment" value="{$v.id}"{if !$tmpid.index && !$idxx.index} checked{/if} />
			    	<!-- if $v.logo1 -->
			    	<img src="{$v.logo1}" style="width:40px;"  />
			    	<!-- /if -->
			    	{$v.title}
				</label>
			</div>
			<!-- /loop -->
		</div>
	</div>
	<!-- /loop -->
	<div class="row p-4">
		<div class="col">
			<a href="{url ctrl=order func=info sn=$rs.sn passwd=$rs.passwd/}" class="btn btn-link">返回订单列表</a>
		</div>
		<div class="col text-right">
			<input type="submit" value="确认付款" class="btn btn-primary" />
		</div>
	</div>
	</form>
</section>
<!-- include tpl=footer -->